{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "16f1d0a9",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import ast\n",
    "import re\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a2f3b7be",
   "metadata": {},
   "outputs": [],
   "source": [
    "list_a=np.arange(22)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "53e6ca61",
   "metadata": {},
   "outputs": [],
   "source": [
    "p1=pd.read_csv(\"测试初始.csv\",low_memory=False,usecols=list_a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d81b4e81",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>性别</th>\n",
       "      <th>入学专业</th>\n",
       "      <th>现在专业</th>\n",
       "      <th>校内活动类型</th>\n",
       "      <th>参加活动情况描述</th>\n",
       "      <th>体测学年</th>\n",
       "      <th>体测总分</th>\n",
       "      <th>图书名称</th>\n",
       "      <th>借阅日期</th>\n",
       "      <th>...</th>\n",
       "      <th>考试成绩</th>\n",
       "      <th>课程学分</th>\n",
       "      <th>课程总学时</th>\n",
       "      <th>考试性质</th>\n",
       "      <th>考试课程类别</th>\n",
       "      <th>考试课程性质</th>\n",
       "      <th>考试课程属性</th>\n",
       "      <th>发布论文年份</th>\n",
       "      <th>辅修专业名称</th>\n",
       "      <th>荣誉称号名称</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>['女']</td>\n",
       "      <td>['邮政管理（互联网与智慧物流）']</td>\n",
       "      <td>['信息安全']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['', '2018', '2019']</td>\n",
       "      <td>['', '85.5', '84']</td>\n",
       "      <td>['', 'C程序设计', 'MAYA动画项目实战从入门到精通', '黑客攻防 : 实战加密...</td>\n",
       "      <td>['', '2018-9-18 11:29', '2018-11-28 22:22', '2...</td>\n",
       "      <td>...</td>\n",
       "      <td>['', '85', '89', '79', '80', '91', '87', '65',...</td>\n",
       "      <td>['', '2', '1', '3', '1', '2', '3', '5', '3', '...</td>\n",
       "      <td>['', '32', '0', '48', '16', '32', '48', '80', ...</td>\n",
       "      <td>['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...</td>\n",
       "      <td>['', '集中性实践环节', '集中性实践环节', '理论课（不含实践）', '理论课（不...</td>\n",
       "      <td>['', '实践教学课', '实践教学课', '其他', '其他', '公共选修课', '公...</td>\n",
       "      <td>['', '必修', '必修', '任选', '任选', '任选', '必修', '任选',...</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>['男']</td>\n",
       "      <td>['软件工程']</td>\n",
       "      <td>['软件工程']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['', '2018', '2019']</td>\n",
       "      <td>['', '68.9', '69.8']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>...</td>\n",
       "      <td>['', '83', '84', '84', '84', '84', '84', '88',...</td>\n",
       "      <td>['', '1', '3', '3', '3', '3', '3', '1', '0', '...</td>\n",
       "      <td>['', '32', '0', '0', '0', '0', '0', '0', '12',...</td>\n",
       "      <td>['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...</td>\n",
       "      <td>['', '理论课（不含实践）', '集中性实践环节', '集中性实践环节', '集中性实践...</td>\n",
       "      <td>['', '公共选修课', '实践教学课', '实践教学课', '实践教学课', '实践教学...</td>\n",
       "      <td>['', '必修', '必修', '必修', '必修', '必修', '必修', '必修',...</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['', '学习进步奖']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2</td>\n",
       "      <td>['男']</td>\n",
       "      <td>['软件工程']</td>\n",
       "      <td>['软件工程']</td>\n",
       "      <td>['', '文化活动']</td>\n",
       "      <td>['', '无']</td>\n",
       "      <td>['', '2018', '2019']</td>\n",
       "      <td>['', '58.8', '62.3']</td>\n",
       "      <td>['', '行星舰队 = Fleet of worlds', '行星舰队 = Fleet o...</td>\n",
       "      <td>['', '2018-9-16 9:35', '2018-10-15 18:11']</td>\n",
       "      <td>...</td>\n",
       "      <td>['', '84', '83', '83', '83', '83', '83', '93',...</td>\n",
       "      <td>['', '1', '3', '3', '3', '3', '3', '1', '2', '...</td>\n",
       "      <td>['', '32', '0', '0', '0', '0', '0', '0', '32',...</td>\n",
       "      <td>['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...</td>\n",
       "      <td>['', '理论课（不含实践）', '集中性实践环节', '集中性实践环节', '集中性实践...</td>\n",
       "      <td>['', '公共选修课', '实践教学课', '实践教学课', '实践教学课', '实践教学...</td>\n",
       "      <td>['', '必修', '必修', '必修', '必修', '必修', '必修', '必修',...</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>3</td>\n",
       "      <td>['男']</td>\n",
       "      <td>['软件工程']</td>\n",
       "      <td>['软件工程']</td>\n",
       "      <td>['', '思想成长']</td>\n",
       "      <td>['', '无']</td>\n",
       "      <td>['', '2018', '2019']</td>\n",
       "      <td>['', '69', '71.7']</td>\n",
       "      <td>['', 'C语言课程设计指导教程', 'C语言课程设计指导教程', '黑客攻防从入门到精通...</td>\n",
       "      <td>['', '2019-8-27 10:47', '2019-10-11 16:23', '2...</td>\n",
       "      <td>...</td>\n",
       "      <td>['', '84', '84', '84', '84', '84', '84', '88',...</td>\n",
       "      <td>['', '1', '3', '3', '3', '3', '3', '1', '1', '...</td>\n",
       "      <td>['', '32', '0', '0', '0', '0', '0', '0', '8', ...</td>\n",
       "      <td>['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...</td>\n",
       "      <td>['', '理论课（不含实践）', '集中性实践环节', '集中性实践环节', '集中性实践...</td>\n",
       "      <td>['', '公共选修课', '实践教学课', '实践教学课', '实践教学课', '实践教学...</td>\n",
       "      <td>['', '必修', '必修', '必修', '必修', '必修', '必修', '必修',...</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4</td>\n",
       "      <td>['男']</td>\n",
       "      <td>['通信工程（双一流实验班，大类招生）']</td>\n",
       "      <td>['通信工程']</td>\n",
       "      <td>['', '思想成长', '学术创新']</td>\n",
       "      <td>['', '无', '无']</td>\n",
       "      <td>['', '2018', '2019']</td>\n",
       "      <td>['', '68.7', '69.4']</td>\n",
       "      <td>['', 'C++程序设计 = Programming abstractions in C+...</td>\n",
       "      <td>['', '2019-3-12 20:45', '2019-3-12 21:06', '20...</td>\n",
       "      <td>...</td>\n",
       "      <td>['', '92', '82', '85', '76', '86', '74', '74',...</td>\n",
       "      <td>['', '1', '2', '0', '2', '2', '1', '5', '3', '...</td>\n",
       "      <td>['', '32', '0', '12', '32', '32', '32', '80', ...</td>\n",
       "      <td>['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...</td>\n",
       "      <td>['', '理论课（不含实践）', '集中性实践环节', '理论课（不含实践）', '理论课...</td>\n",
       "      <td>['', '公共选修课', '实践教学课', '公共选修课', '公共选修课', '公共选修...</td>\n",
       "      <td>['', '必修', '必修', '必修', '必修', '任选', '必修', '必修',...</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "      <td>['']</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 22 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   Unnamed: 0     性别                   入学专业      现在专业                校内活动类型  \\\n",
       "0           0  ['女']     ['邮政管理（互联网与智慧物流）']  ['信息安全']                  ['']   \n",
       "1           1  ['男']               ['软件工程']  ['软件工程']                  ['']   \n",
       "2           2  ['男']               ['软件工程']  ['软件工程']          ['', '文化活动']   \n",
       "3           3  ['男']               ['软件工程']  ['软件工程']          ['', '思想成长']   \n",
       "4           4  ['男']  ['通信工程（双一流实验班，大类招生）']  ['通信工程']  ['', '思想成长', '学术创新']   \n",
       "\n",
       "         参加活动情况描述                  体测学年                  体测总分  \\\n",
       "0            ['']  ['', '2018', '2019']    ['', '85.5', '84']   \n",
       "1            ['']  ['', '2018', '2019']  ['', '68.9', '69.8']   \n",
       "2       ['', '无']  ['', '2018', '2019']  ['', '58.8', '62.3']   \n",
       "3       ['', '无']  ['', '2018', '2019']    ['', '69', '71.7']   \n",
       "4  ['', '无', '无']  ['', '2018', '2019']  ['', '68.7', '69.4']   \n",
       "\n",
       "                                                图书名称  \\\n",
       "0  ['', 'C程序设计', 'MAYA动画项目实战从入门到精通', '黑客攻防 : 实战加密...   \n",
       "1                                               ['']   \n",
       "2  ['', '行星舰队 = Fleet of worlds', '行星舰队 = Fleet o...   \n",
       "3  ['', 'C语言课程设计指导教程', 'C语言课程设计指导教程', '黑客攻防从入门到精通...   \n",
       "4  ['', 'C++程序设计 = Programming abstractions in C+...   \n",
       "\n",
       "                                                借阅日期  ...  \\\n",
       "0  ['', '2018-9-18 11:29', '2018-11-28 22:22', '2...  ...   \n",
       "1                                               ['']  ...   \n",
       "2         ['', '2018-9-16 9:35', '2018-10-15 18:11']  ...   \n",
       "3  ['', '2019-8-27 10:47', '2019-10-11 16:23', '2...  ...   \n",
       "4  ['', '2019-3-12 20:45', '2019-3-12 21:06', '20...  ...   \n",
       "\n",
       "                                                考试成绩  \\\n",
       "0  ['', '85', '89', '79', '80', '91', '87', '65',...   \n",
       "1  ['', '83', '84', '84', '84', '84', '84', '88',...   \n",
       "2  ['', '84', '83', '83', '83', '83', '83', '93',...   \n",
       "3  ['', '84', '84', '84', '84', '84', '84', '88',...   \n",
       "4  ['', '92', '82', '85', '76', '86', '74', '74',...   \n",
       "\n",
       "                                                课程学分  \\\n",
       "0  ['', '2', '1', '3', '1', '2', '3', '5', '3', '...   \n",
       "1  ['', '1', '3', '3', '3', '3', '3', '1', '0', '...   \n",
       "2  ['', '1', '3', '3', '3', '3', '3', '1', '2', '...   \n",
       "3  ['', '1', '3', '3', '3', '3', '3', '1', '1', '...   \n",
       "4  ['', '1', '2', '0', '2', '2', '1', '5', '3', '...   \n",
       "\n",
       "                                               课程总学时  \\\n",
       "0  ['', '32', '0', '48', '16', '32', '48', '80', ...   \n",
       "1  ['', '32', '0', '0', '0', '0', '0', '0', '12',...   \n",
       "2  ['', '32', '0', '0', '0', '0', '0', '0', '32',...   \n",
       "3  ['', '32', '0', '0', '0', '0', '0', '0', '8', ...   \n",
       "4  ['', '32', '0', '12', '32', '32', '32', '80', ...   \n",
       "\n",
       "                                                考试性质  \\\n",
       "0  ['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...   \n",
       "1  ['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...   \n",
       "2  ['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...   \n",
       "3  ['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...   \n",
       "4  ['', '正常考试', '正常考试', '正常考试', '正常考试', '正常考试', '...   \n",
       "\n",
       "                                              考试课程类别  \\\n",
       "0  ['', '集中性实践环节', '集中性实践环节', '理论课（不含实践）', '理论课（不...   \n",
       "1  ['', '理论课（不含实践）', '集中性实践环节', '集中性实践环节', '集中性实践...   \n",
       "2  ['', '理论课（不含实践）', '集中性实践环节', '集中性实践环节', '集中性实践...   \n",
       "3  ['', '理论课（不含实践）', '集中性实践环节', '集中性实践环节', '集中性实践...   \n",
       "4  ['', '理论课（不含实践）', '集中性实践环节', '理论课（不含实践）', '理论课...   \n",
       "\n",
       "                                              考试课程性质  \\\n",
       "0  ['', '实践教学课', '实践教学课', '其他', '其他', '公共选修课', '公...   \n",
       "1  ['', '公共选修课', '实践教学课', '实践教学课', '实践教学课', '实践教学...   \n",
       "2  ['', '公共选修课', '实践教学课', '实践教学课', '实践教学课', '实践教学...   \n",
       "3  ['', '公共选修课', '实践教学课', '实践教学课', '实践教学课', '实践教学...   \n",
       "4  ['', '公共选修课', '实践教学课', '公共选修课', '公共选修课', '公共选修...   \n",
       "\n",
       "                                              考试课程属性 发布论文年份 辅修专业名称  \\\n",
       "0  ['', '必修', '必修', '任选', '任选', '任选', '必修', '任选',...   ['']   ['']   \n",
       "1  ['', '必修', '必修', '必修', '必修', '必修', '必修', '必修',...   ['']   ['']   \n",
       "2  ['', '必修', '必修', '必修', '必修', '必修', '必修', '必修',...   ['']   ['']   \n",
       "3  ['', '必修', '必修', '必修', '必修', '必修', '必修', '必修',...   ['']   ['']   \n",
       "4  ['', '必修', '必修', '必修', '必修', '任选', '必修', '必修',...   ['']   ['']   \n",
       "\n",
       "          荣誉称号名称  \n",
       "0           ['']  \n",
       "1  ['', '学习进步奖']  \n",
       "2           ['']  \n",
       "3           ['']  \n",
       "4           ['']  \n",
       "\n",
       "[5 rows x 22 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p1.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "e1e6ee57",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       ['', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '...\n",
       "1       ['', '观众0.2一次，最多0.8', '', '', '二挡9分', '', '', ...\n",
       "2                                ['', '无', '无', '无', '无']\n",
       "3                                                    ['']\n",
       "4       ['', '活动参与 加1分', '参与奖 加2分', '活动参与 加1分', '11 月 ...\n",
       "                              ...                        \n",
       "6902    ['', '参与5分', '无', '人人都有5分', '被选中3分', '无', '参与2...\n",
       "6903                                                 ['']\n",
       "6904                                 ['', '参与1分', '参与1分']\n",
       "6905    ['', '5次5分', '获奖2分', '3分2次', '3次3分', '参与2次4分',...\n",
       "6906    ['', '无', '无', '一档10分', '参与1分', '观众0.5分', '观众0...\n",
       "Name: 参加活动情况描述, Length: 6907, dtype: object"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p1[\"参加活动情况描述\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "84417d3b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\"['', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '无', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '无', '无']\""
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "p1[\"参加活动情况描述\"][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ebada70f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(p1[\"参加活动情况描述\"][1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "394316a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "p2=ast.literal_eval(p1[\"参加活动情况描述\"][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "9ad74501",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "list"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(p2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "8850f5e3",
   "metadata": {},
   "outputs": [],
   "source": [
    "p3=ast.literal_eval(p1[\"参加活动情况描述\"][1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "id": "18d51598",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "unsupported operand type(s) for &: 'str' and 'int'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-59-491b654e843c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;31m# pattern=re.compile(r\"^(([0-9]{1,}[.]){0,1}[0-9]*)$\")\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m \u001b[1;31m# pattern=re.compile(r\"(\\d{1,}[.]){0,1})\\d{1,}\")\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 5\u001b[1;33m \u001b[0mpattern1\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mre\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcompile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"[\\\\u4e00-\\\\u9fa5]\"\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m\"分\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      6\u001b[0m \u001b[1;31m# bool flag1=Pattern.matches(\"[\\\\u4e00-\\\\u9fa5]\",\"分\");\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\re.py\u001b[0m in \u001b[0;36mcompile\u001b[1;34m(pattern, flags)\u001b[0m\n\u001b[0;32m    250\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mcompile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    251\u001b[0m     \u001b[1;34m\"Compile a regular expression pattern, returning a Pattern object.\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 252\u001b[1;33m     \u001b[1;32mreturn\u001b[0m \u001b[0m_compile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    253\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    254\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mpurge\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\re.py\u001b[0m in \u001b[0;36m_compile\u001b[1;34m(pattern, flags)\u001b[0m\n\u001b[0;32m    302\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[0msre_compile\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0misstring\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    303\u001b[0m         \u001b[1;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"first argument must be string or compiled pattern\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 304\u001b[1;33m     \u001b[0mp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0msre_compile\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcompile\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    305\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[1;32mnot\u001b[0m \u001b[1;33m(\u001b[0m\u001b[0mflags\u001b[0m \u001b[1;33m&\u001b[0m \u001b[0mDEBUG\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    306\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0m_cache\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m>=\u001b[0m \u001b[0m_MAXCACHE\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\sre_compile.py\u001b[0m in \u001b[0;36mcompile\u001b[1;34m(p, flags)\u001b[0m\n\u001b[0;32m    762\u001b[0m     \u001b[1;32mif\u001b[0m \u001b[0misstring\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    763\u001b[0m         \u001b[0mpattern\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mp\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 764\u001b[1;33m         \u001b[0mp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0msre_parse\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mparse\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    765\u001b[0m     \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    766\u001b[0m         \u001b[0mpattern\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;32mNone\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\anaconda3\\lib\\sre_parse.py\u001b[0m in \u001b[0;36mparse\u001b[1;34m(str, flags, state)\u001b[0m\n\u001b[0;32m    946\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    947\u001b[0m     \u001b[1;32mtry\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 948\u001b[1;33m         \u001b[0mp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0m_parse_sub\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0msource\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstate\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mflags\u001b[0m \u001b[1;33m&\u001b[0m \u001b[0mSRE_FLAG_VERBOSE\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m0\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    949\u001b[0m     \u001b[1;32mexcept\u001b[0m \u001b[0mVerbose\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    950\u001b[0m         \u001b[1;31m# the VERBOSE flag was switched on inside the pattern.  to be\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mTypeError\u001b[0m: unsupported operand type(s) for &: 'str' and 'int'"
     ]
    }
   ],
   "source": [
    "# pattern=re.compile(r\"\\]\\,\\ \\\".{22}\\=\\=\\\"\\:\\ \\[\")\n",
    "# pattern=re.compile(r\"^\\d{0,2}\\.*\\d$\")\n",
    "# pattern=re.compile(r\"^(([0-9]{1,}[.]){0,1}[0-9]*)$\")\n",
    "pattern=re.compile(r\"(\\d{1,}[.]){0,1})\\d{1,}\")\n",
    "# pattern1=re.compile(\"[\\\\u4e00-\\\\u9fa5]\",\"分\")\n",
    "# bool flag1=Pattern.matches(\"[\\\\u4e00-\\\\u9fa5]\",\"分\");"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "77a33a39",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "16"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(p3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "id": "732e3179",
   "metadata": {},
   "outputs": [],
   "source": [
    "data=p3[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "id": "a3dc56b1",
   "metadata": {},
   "outputs": [],
   "source": [
    "deal_done=pattern.findall(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "id": "f6623e5d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "deal_done"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "706bf39a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "id": "5f1db469",
   "metadata": {},
   "outputs": [],
   "source": [
    "deal_done=list(map(float,deal_done))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "340be771",
   "metadata": {},
   "outputs": [
    {
     "ename": "IndexError",
     "evalue": "list index out of range",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-53-1be8a34d034d>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtype\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdeal_done\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mIndexError\u001b[0m: list index out of range"
     ]
    }
   ],
   "source": [
    "print(type(deal_done[0]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "fa8d8acb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(deal_done)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d03177b7",
   "metadata": {},
   "source": [
    "# 数字匹配"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "id": "71756b57",
   "metadata": {},
   "outputs": [],
   "source": [
    "p3=ast.literal_eval(p1[\"参加活动情况描述\"][1])\n",
    "pattern=re.compile(r\"\\d{1}[.]\\d{1}\")\n",
    "deal_done=pattern.findall(data)\n",
    "deal_done=list(map(float,deal_done))\n",
    "flosum=sum(deal_done)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "id": "d069212d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1.0"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "flosum"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 135,
   "id": "b12f4e2b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['', '活动参与 加1@', '参与奖 加2@', '活动参与 加1@', '11 月 25 日比赛观众 加1@', '无', '无', '如实填写', '无', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '无', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '如实填写', '无']\n",
      "23\n",
      "[['1@'], ['2@'], ['1@'], ['1@']]\n"
     ]
    }
   ],
   "source": [
    "t=p1[\"参加活动情况描述\"][4]\n",
    "t=t.replace(\"分\",\"@\")  #此时t为str类型\n",
    "\n",
    "p3=ast.literal_eval(t)  #此时p3为list类型\n",
    "print(p3)\n",
    "l=len(p3)\n",
    "real_done=[]\n",
    "real_done_done=[]\n",
    "for i in range (1,l-1):\n",
    "    data=p3[i]              #定位到list中的某一个标签\n",
    "    pattern=re.compile(r\"\\d{1}\\@\")    #正则表达式匹配\n",
    "    deal_done=pattern.findall(data)   #找到符合条件的值并打印结果\n",
    "    real_done.append(deal_done)\n",
    "for i in range(0,len(real_done)):\n",
    "    if len(real_done[i])!=0:\n",
    "        real_done_done.append(real_done[i])\n",
    "print(real_done_done)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 147,
   "id": "c7ae98e8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5.0\n"
     ]
    }
   ],
   "source": [
    "total=0\n",
    "# print(float(real_done_done[1][0][:-1]))\n",
    "for i in range(0,len(real_done_done)):\n",
    "    for j in range(0,len(real_done[i]))\n",
    "         mark=float(real_done_done[i][j][:-1])\n",
    "         total=total+mark\n",
    "print(total)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 164,
   "id": "998beadb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['', '观众/1@', '二等奖/4@', '主办/4@', '观众/1@', '观众/1@', '8@', '1次/1@', '4@', '观众2场/0.75@', '10h以下/3@', '观众1场/0.5@', '观众1场/0.4@', '观众1场/1@', '观众1场/0.75@', '观众/1@']\n",
      "[['1@'], ['4@'], ['4@'], ['1@'], ['1@'], ['8@'], ['1@'], ['4@'], ['0.75@'], ['3@'], ['0.5@'], ['0.4@'], ['1@'], ['0.75@'], ['1@']]\n"
     ]
    }
   ],
   "source": [
    "t=p1[\"参加活动情况描述\"][20]\n",
    "t=t.replace(\"分\",\"@\")  #此时t为str类型\n",
    "\n",
    "p3=ast.literal_eval(t)  #此时p3为list类型\n",
    "print(p3)\n",
    "l=len(p3)\n",
    "real_done=[]\n",
    "real_done_done=[]\n",
    "for i in range (1,l):\n",
    "    data=p3[i]              #定位到list中的某一个标签\n",
    "    pattern=re.compile(r\"\\d{0,2}\\.{0,1}\\d{1,3}\\@\")    #正则表达式匹配\n",
    "    deal_done=pattern.findall(data)   #找到符合条件的值并打印结果\n",
    "    real_done.append(deal_done)\n",
    "for i in range(0,len(real_done)):\n",
    "    if len(real_done[i])!=0:\n",
    "        real_done_done.append(real_done[i])\n",
    "print(real_done_done)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 165,
   "id": "0a3f6c10",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "31.4\n"
     ]
    }
   ],
   "source": [
    "total=0\n",
    "# print(float(real_done_done[1][0][:-1]))\n",
    "for i in range(0,len(real_done_done)):\n",
    "    for j in range(0,len(real_done_done[i])):\n",
    "         mark=float(real_done_done[i][j][:-1])\n",
    "         total=total+mark\n",
    "print(total)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 171,
   "id": "a2f94126",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0   0\n",
      "1   23.0\n",
      "2   0\n",
      "3   0\n",
      "4   5.0\n",
      "5   78.025\n",
      "6   0\n",
      "7   2.0\n",
      "8   0\n",
      "9   0\n"
     ]
    }
   ],
   "source": [
    "for k in range(0,10):\n",
    "    t=p1[\"参加活动情况描述\"][k]\n",
    "    t=t.replace(\"分\",\"@\")  #此时t为str类型\n",
    "    total=0\n",
    "    p3=ast.literal_eval(t)  #此时p3为list类型\n",
    "#     print(p3)\n",
    "    l=len(p3)\n",
    "    real_done=[]         #带有空列表的分数列表\n",
    "    real_done_done=[]    #去掉空列表的分数列表\n",
    "    for i in range (1,l):\n",
    "        data=p3[i]              #定位到list中的某一个标签\n",
    "        pattern=re.compile(r\"\\d{0,2}\\.{0,1}\\d{1,3}\\@\")    #正则表达式匹配\n",
    "        deal_done=pattern.findall(data)   #找到符合条件的值并打印结果\n",
    "        real_done.append(deal_done)\n",
    "        \n",
    "    for i in range(0,len(real_done)):\n",
    "        if len(real_done[i])!=0:\n",
    "            real_done_done.append(real_done[i])\n",
    "    for i in range(0,len(real_done_done)):\n",
    "        for j in range(0,len(real_done_done[i])):\n",
    "             mark=float(real_done_done[i][j][:-1])\n",
    "             total=total+mark\n",
    "    print(str(k)+\"   \"+str(total))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 174,
   "id": "65a2233f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{0: 1}\n"
     ]
    }
   ],
   "source": [
    "dict={}\n",
    "dict[0]=1\n",
    "print(dict)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "053f2316",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0   0\n",
      "1   0\n",
      "2   0\n",
      "3   0\n",
      "4   0\n",
      "5   0\n",
      "6   0\n",
      "7   0\n",
      "8   77.0\n",
      "9   37.7\n",
      "10   10.0\n",
      "11   0\n",
      "12   0\n",
      "13   50.0\n",
      "14   0\n",
      "15   102.1\n",
      "16   0\n",
      "17   11.0\n",
      "18   0\n",
      "19   0\n",
      "20   0\n",
      "21   2.6\n",
      "22   22.1\n",
      "23   10.0\n",
      "24   89.0\n",
      "25   100.0\n",
      "26   54.5\n",
      "27   0\n",
      "28   38.375\n",
      "29   0\n",
      "30   0\n",
      "31   0\n",
      "32   0\n",
      "33   30.5\n",
      "34   0\n",
      "35   32.0\n",
      "36   2.0\n",
      "37   5.1\n",
      "38   0\n",
      "39   0\n",
      "40   0\n",
      "41   0\n",
      "42   0\n",
      "43   0\n",
      "44   0\n",
      "45   0\n",
      "46   0\n",
      "47   38.5\n",
      "48   0\n",
      "49   10.0\n",
      "50   19.0\n",
      "51   0\n",
      "52   0\n",
      "53   0\n",
      "54   0\n",
      "55   0\n",
      "56   0\n",
      "57   0\n",
      "58   0\n",
      "59   0\n",
      "60   0\n",
      "61   0\n",
      "62   0\n",
      "63   39.05\n",
      "64   0\n",
      "65   0\n",
      "66   0\n",
      "67   13.5\n",
      "68   0\n",
      "69   6.5\n",
      "70   0\n",
      "71   1.5\n",
      "72   5.0\n",
      "73   0\n",
      "74   0\n",
      "75   0\n",
      "76   5.0\n",
      "77   0\n",
      "78   0\n",
      "79   0\n",
      "80   0\n",
      "81   0\n",
      "82   0\n",
      "83   0\n",
      "84   0\n",
      "85   0\n",
      "86   24.400000000000002\n",
      "87   0\n",
      "88   5.1\n",
      "89   0\n",
      "90   0\n",
      "91   0\n",
      "92   62.0\n",
      "93   34.0\n",
      "94   0\n",
      "95   0\n",
      "96   0\n",
      "97   0\n",
      "98   0\n",
      "99   0\n",
      "100   0\n",
      "101   28.0\n",
      "102   0\n",
      "103   0\n",
      "104   0\n",
      "105   78.5\n",
      "106   0\n",
      "107   39.0\n",
      "108   16.0\n",
      "109   26.2\n",
      "110   19.0\n",
      "111   0\n",
      "112   1.5\n",
      "113   6.75\n",
      "114   8.5\n",
      "115   0\n",
      "116   0\n",
      "117   0\n",
      "118   0\n",
      "119   0\n",
      "120   0\n",
      "121   0\n",
      "122   0\n",
      "123   54.0\n",
      "124   0\n",
      "125   0\n",
      "126   0\n",
      "127   0\n",
      "128   0\n",
      "129   21.5\n",
      "130   0\n",
      "131   29.0\n",
      "132   0\n",
      "133   0\n",
      "134   0\n",
      "135   0\n",
      "136   0\n",
      "137   0\n",
      "138   12.5\n",
      "139   13.899999999999999\n",
      "140   6.5\n",
      "141   36.0\n",
      "142   0\n",
      "143   33.0\n",
      "144   0\n",
      "145   1.3\n",
      "146   72.0\n",
      "147   16.3\n",
      "148   0\n",
      "149   63.0\n",
      "150   0\n",
      "151   0\n",
      "152   0\n",
      "153   115.5\n",
      "154   0\n",
      "155   0\n",
      "156   8.5\n",
      "157   0\n",
      "158   5.0\n",
      "159   0\n",
      "160   8.0\n",
      "161   35.5\n",
      "162   45.650000000000006\n",
      "163   0\n",
      "164   0\n",
      "165   0\n",
      "166   12.0\n",
      "167   0\n",
      "168   0.5\n",
      "169   0\n",
      "170   0\n",
      "171   0\n",
      "172   0\n",
      "173   0\n",
      "174   0\n",
      "175   0\n",
      "176   0\n",
      "177   0\n",
      "178   10.0\n",
      "179   0\n",
      "180   5.0\n",
      "181   5.0\n",
      "182   0\n",
      "183   0\n",
      "184   0\n",
      "185   0\n",
      "186   0\n",
      "187   0\n",
      "188   2.5\n",
      "189   0\n",
      "190   0\n",
      "191   0\n",
      "192   23.0\n",
      "193   3.5\n",
      "194   0\n",
      "195   0\n",
      "196   0\n",
      "197   0\n",
      "198   0\n",
      "199   0\n",
      "200   0\n",
      "201   0\n",
      "202   0\n",
      "203   0\n",
      "204   0\n",
      "205   0\n",
      "206   0\n",
      "207   0\n",
      "208   0\n",
      "209   0\n",
      "210   0\n",
      "211   0\n",
      "212   0\n",
      "213   0\n",
      "214   0\n",
      "215   0\n",
      "216   0\n",
      "217   0\n",
      "218   0\n",
      "219   0\n",
      "220   0\n",
      "221   0\n",
      "222   0\n",
      "223   0\n",
      "224   0\n",
      "225   0\n",
      "226   0\n",
      "227   0\n",
      "228   0\n",
      "229   37.5\n",
      "230   34.0\n",
      "231   0\n",
      "232   0\n",
      "233   18.0\n",
      "234   28.0\n",
      "235   15.0\n",
      "236   33.5\n",
      "237   0\n",
      "238   15.0\n",
      "239   0\n",
      "240   0\n",
      "241   0\n",
      "242   0\n",
      "243   0\n",
      "244   0\n",
      "245   0\n",
      "246   0\n",
      "247   0\n",
      "248   0\n",
      "249   0\n",
      "250   0\n",
      "251   0\n",
      "252   0\n",
      "253   19.0\n",
      "254   1.5\n",
      "255   0\n",
      "256   0\n",
      "257   0\n",
      "258   0\n",
      "259   0\n",
      "260   0\n",
      "261   0\n",
      "262   0\n",
      "263   0\n",
      "264   0\n",
      "265   0\n",
      "266   32.1\n",
      "267   0\n",
      "268   81.0\n",
      "269   1.5\n",
      "270   0\n",
      "271   0\n",
      "272   0\n",
      "273   8.5\n",
      "274   5.0\n",
      "275   0\n",
      "276   0\n",
      "277   9.0\n",
      "278   11.5\n",
      "279   8.0\n",
      "280   0\n",
      "281   3.0\n",
      "282   0\n",
      "283   3.5\n",
      "284   0\n",
      "285   0\n",
      "286   0\n",
      "287   0\n",
      "288   0\n",
      "289   2.0\n",
      "290   2.0\n",
      "291   68.05\n",
      "292   0\n",
      "293   0\n",
      "294   5.1\n",
      "295   0\n",
      "296   0\n",
      "297   0\n",
      "298   0\n",
      "299   0\n",
      "300   0\n",
      "301   0\n",
      "302   80.95\n",
      "303   0\n",
      "304   0\n",
      "305   0\n",
      "306   21.0\n",
      "307   8.0\n",
      "308   50.0\n",
      "309   0\n",
      "310   0\n",
      "311   0\n",
      "312   0\n",
      "313   0\n",
      "314   0\n",
      "315   0\n",
      "316   6.0\n",
      "317   2.0\n",
      "318   0\n",
      "319   0\n",
      "320   0\n",
      "321   10.0\n",
      "322   15.5\n",
      "323   33.0\n",
      "324   0\n",
      "325   0\n",
      "326   0\n",
      "327   0\n",
      "328   4.5\n",
      "329   2.5\n",
      "330   17.5\n",
      "331   3.25\n",
      "332   38.0\n",
      "333   61.400000000000006\n",
      "334   1.0\n",
      "335   19.0\n",
      "336   0\n",
      "337   0\n",
      "338   0\n",
      "339   0\n",
      "340   0\n",
      "341   0\n",
      "342   16.5\n",
      "343   0\n",
      "344   0\n",
      "345   0\n",
      "346   0\n",
      "347   0\n",
      "348   0\n",
      "349   29.0\n",
      "350   42.0\n",
      "351   0\n",
      "352   0\n",
      "353   0\n",
      "354   0\n",
      "355   0\n",
      "356   0\n",
      "357   0\n",
      "358   0\n",
      "359   0\n",
      "360   0\n",
      "361   0\n",
      "362   0\n",
      "363   0\n",
      "364   0\n",
      "365   0\n",
      "366   0\n",
      "367   0\n",
      "368   0\n",
      "369   0\n",
      "370   0\n",
      "371   0\n",
      "372   0\n",
      "373   0\n",
      "374   0\n",
      "375   0\n",
      "376   0.5\n",
      "377   0\n",
      "378   0\n",
      "379   0\n",
      "380   0\n",
      "381   0\n",
      "382   0\n",
      "383   0\n",
      "384   0\n",
      "385   0\n",
      "386   0\n",
      "387   0\n",
      "388   0\n",
      "389   0\n",
      "390   0\n",
      "391   0\n",
      "392   0\n",
      "393   0\n",
      "394   0\n",
      "395   0\n",
      "396   0\n",
      "397   0\n",
      "398   6.0\n",
      "399   14.0\n",
      "400   0\n",
      "401   0\n",
      "402   0\n",
      "403   0\n",
      "404   98.8\n",
      "405   34.0\n",
      "406   0\n",
      "407   0\n",
      "408   0\n",
      "409   0\n",
      "410   0\n",
      "411   0\n",
      "412   0\n",
      "413   0\n",
      "414   0\n",
      "415   0\n",
      "416   0\n",
      "417   0\n",
      "418   5.5\n",
      "419   1.0\n",
      "420   0\n",
      "421   0\n",
      "422   0\n",
      "423   0\n",
      "424   0\n",
      "425   0\n",
      "426   0\n",
      "427   0\n",
      "428   0\n",
      "429   0\n",
      "430   0\n",
      "431   0\n",
      "432   0\n",
      "433   0\n",
      "434   52.0\n",
      "435   0\n",
      "436   0\n",
      "437   0\n",
      "438   0\n",
      "439   0\n",
      "440   0\n",
      "441   0\n",
      "442   0\n",
      "443   0\n",
      "444   0\n",
      "445   3.0\n",
      "446   0\n",
      "447   0\n",
      "448   0\n",
      "449   0\n",
      "450   0\n",
      "451   0\n",
      "452   0\n",
      "453   0\n",
      "454   0\n",
      "455   0\n",
      "456   0\n",
      "457   0\n",
      "458   0\n",
      "459   0\n",
      "460   0\n",
      "461   0\n",
      "462   0\n",
      "463   0\n",
      "464   0\n",
      "465   0\n",
      "466   0\n",
      "467   40.0\n",
      "468   10.299999999999999\n",
      "469   49.25\n",
      "470   0\n",
      "471   31.0\n",
      "472   0\n",
      "473   0\n",
      "474   3.0\n",
      "475   0\n",
      "476   87.6\n",
      "477   56.0\n",
      "478   0\n",
      "479   4.0\n",
      "480   0\n",
      "481   7.0\n",
      "482   0\n",
      "483   32.5\n",
      "484   48.45\n",
      "485   29.0\n",
      "486   23.8\n",
      "487   36.0\n",
      "488   0\n",
      "489   0\n",
      "490   0\n",
      "491   16.25\n",
      "492   31.0\n",
      "493   29.0\n",
      "494   0\n",
      "495   0\n",
      "496   0\n",
      "497   0\n",
      "498   0\n",
      "499   0\n",
      "500   0\n",
      "501   0\n",
      "502   0\n",
      "503   0\n",
      "504   0\n",
      "505   0\n",
      "506   0\n",
      "507   7.0\n",
      "508   0\n",
      "509   0\n",
      "510   0\n",
      "511   0\n",
      "512   0\n",
      "513   0\n",
      "514   0\n",
      "515   0\n",
      "516   33.0\n",
      "517   48.0\n",
      "518   0\n",
      "519   54.0\n",
      "520   0\n",
      "521   27.0\n",
      "522   0\n",
      "523   0\n",
      "524   0\n",
      "525   5.0\n",
      "526   0\n",
      "527   0\n",
      "528   0\n",
      "529   0\n",
      "530   0\n",
      "531   0\n",
      "532   0\n",
      "533   7.5\n",
      "534   6.0\n",
      "535   45.75\n",
      "536   14.25\n",
      "537   0\n",
      "538   0\n",
      "539   0\n",
      "540   0\n",
      "541   0\n",
      "542   0\n",
      "543   0\n",
      "544   25.0\n",
      "545   0\n",
      "546   0\n",
      "547   87.0\n",
      "548   25.0\n",
      "549   0\n",
      "550   54.0\n",
      "551   0\n",
      "552   54.0\n",
      "553   0\n",
      "554   3.0\n",
      "555   0\n",
      "556   0\n",
      "557   0\n",
      "558   7.0\n",
      "559   0\n",
      "560   132.5\n",
      "561   59.0\n",
      "562   17.0\n",
      "563   15.5\n",
      "564   0\n",
      "565   0\n",
      "566   0\n",
      "567   0\n",
      "568   0\n",
      "569   0\n",
      "570   0\n",
      "571   0\n",
      "572   0\n",
      "573   0\n",
      "574   0\n",
      "575   0\n",
      "576   0\n",
      "577   0\n",
      "578   0\n",
      "579   0\n",
      "580   1.0\n",
      "581   0\n",
      "582   5.5\n",
      "583   0\n",
      "584   30.5\n",
      "585   0\n",
      "586   0\n",
      "587   5.0\n",
      "588   0\n",
      "589   43.0\n",
      "590   5.1\n",
      "591   0\n",
      "592   0\n",
      "593   11.0\n",
      "594   0\n",
      "595   0\n",
      "596   0\n",
      "597   0\n",
      "598   0\n",
      "599   0\n",
      "600   0\n",
      "601   34.0\n",
      "602   0\n",
      "603   0\n",
      "604   0\n",
      "605   0\n",
      "606   0\n",
      "607   0\n",
      "608   0\n",
      "609   0\n",
      "610   0\n",
      "611   0\n",
      "612   0\n",
      "613   2.5\n",
      "614   0\n",
      "615   78.75\n",
      "616   46.0\n",
      "617   0\n",
      "618   0\n",
      "619   0\n",
      "620   24.5\n",
      "621   0\n",
      "622   8.5\n",
      "623   0\n",
      "624   0\n",
      "625   0\n",
      "626   0\n",
      "627   0\n",
      "628   0\n",
      "629   0\n",
      "630   0\n",
      "631   0\n",
      "632   0\n",
      "633   0\n",
      "634   0\n",
      "635   0\n",
      "636   0\n",
      "637   0\n",
      "638   0\n",
      "639   0\n",
      "640   29.0\n",
      "641   0\n",
      "642   0\n",
      "643   0\n",
      "644   43.0\n",
      "645   35.0\n",
      "646   36.2\n",
      "647   64.5\n",
      "648   20.0\n",
      "649   15.7\n",
      "650   0\n",
      "651   0\n",
      "652   0\n",
      "653   0\n",
      "654   0\n",
      "655   1.0\n",
      "656   0\n",
      "657   6.5\n",
      "658   3.5\n",
      "659   12.5\n",
      "660   7.5\n",
      "661   0\n",
      "662   3.5\n",
      "663   27.0\n",
      "664   0\n",
      "665   40.0\n",
      "666   5.5\n",
      "667   18.0\n",
      "668   87.0\n",
      "669   0\n",
      "670   0\n",
      "671   1.0\n",
      "672   2.0\n",
      "673   0\n",
      "674   51.00000000000001\n",
      "675   0\n",
      "676   19.0\n",
      "677   31.7\n",
      "678   12.0\n",
      "679   0\n",
      "680   0\n",
      "681   0\n",
      "682   0\n",
      "683   1.5\n",
      "684   2.5\n",
      "685   2.0\n",
      "686   0\n",
      "687   2.5\n",
      "688   0\n",
      "689   87.45\n",
      "690   0\n",
      "691   0\n",
      "692   0\n",
      "693   0\n",
      "694   34.0\n",
      "695   2.5\n",
      "696   10.0\n",
      "697   0\n",
      "698   0\n",
      "699   0\n",
      "700   0\n",
      "701   0\n",
      "702   0\n",
      "703   0\n",
      "704   0\n",
      "705   0\n",
      "706   0\n",
      "707   0\n",
      "708   0\n",
      "709   1.5\n",
      "710   0\n",
      "711   0\n",
      "712   0\n",
      "713   0\n",
      "714   0\n",
      "715   0\n",
      "716   0\n",
      "717   0\n",
      "718   0\n",
      "719   0\n",
      "720   0\n",
      "721   0\n",
      "722   0\n",
      "723   0\n",
      "724   0\n",
      "725   0\n",
      "726   0\n",
      "727   0\n",
      "728   0\n",
      "729   0\n",
      "730   0\n",
      "731   0\n",
      "732   3.0\n",
      "733   0\n",
      "734   0\n",
      "735   0\n",
      "736   0\n",
      "737   0\n",
      "738   51.1\n",
      "739   19.5\n",
      "740   0\n",
      "741   12.5\n",
      "742   0\n",
      "743   0\n",
      "744   4.0\n",
      "745   5.1\n",
      "746   0\n",
      "747   0\n",
      "748   5.1\n",
      "749   10.0\n",
      "750   5.0\n",
      "751   0\n",
      "752   5.1\n",
      "753   5.1\n",
      "754   19.0\n",
      "755   0\n",
      "756   23.0\n",
      "757   27.0\n",
      "758   16.5\n",
      "759   0\n",
      "760   30.0\n",
      "761   0\n",
      "762   0\n",
      "763   0\n",
      "764   5.5\n",
      "765   17.0\n",
      "766   30.0\n",
      "767   0\n",
      "768   0\n",
      "769   0\n",
      "770   0\n",
      "771   0\n",
      "772   0\n",
      "773   0\n",
      "774   0\n",
      "775   0\n",
      "776   0\n",
      "777   0\n",
      "778   14.0\n",
      "779   16.0\n",
      "780   55.0\n",
      "781   71.0\n",
      "782   106.1\n",
      "783   0\n",
      "784   0\n",
      "785   0\n",
      "786   9.0\n",
      "787   0\n",
      "788   0\n",
      "789   0\n",
      "790   26.0\n",
      "791   0\n",
      "792   0\n",
      "793   0\n",
      "794   0\n",
      "795   55.5\n",
      "796   0\n",
      "797   43.6\n",
      "798   56.6\n",
      "799   0\n",
      "{0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0, 6: 0, 7: 0, 8: 77.0, 9: 37.7, 10: 10.0, 11: 0, 12: 0, 13: 50.0, 14: 0, 15: 102.1, 16: 0, 17: 11.0, 18: 0, 19: 0, 20: 0, 21: 2.6, 22: 22.1, 23: 10.0, 24: 89.0, 25: 100.0, 26: 54.5, 27: 0, 28: 38.375, 29: 0, 30: 0, 31: 0, 32: 0, 33: 30.5, 34: 0, 35: 32.0, 36: 2.0, 37: 5.1, 38: 0, 39: 0, 40: 0, 41: 0, 42: 0, 43: 0, 44: 0, 45: 0, 46: 0, 47: 38.5, 48: 0, 49: 10.0, 50: 19.0, 51: 0, 52: 0, 53: 0, 54: 0, 55: 0, 56: 0, 57: 0, 58: 0, 59: 0, 60: 0, 61: 0, 62: 0, 63: 39.05, 64: 0, 65: 0, 66: 0, 67: 13.5, 68: 0, 69: 6.5, 70: 0, 71: 1.5, 72: 5.0, 73: 0, 74: 0, 75: 0, 76: 5.0, 77: 0, 78: 0, 79: 0, 80: 0, 81: 0, 82: 0, 83: 0, 84: 0, 85: 0, 86: 24.400000000000002, 87: 0, 88: 5.1, 89: 0, 90: 0, 91: 0, 92: 62.0, 93: 34.0, 94: 0, 95: 0, 96: 0, 97: 0, 98: 0, 99: 0, 100: 0, 101: 28.0, 102: 0, 103: 0, 104: 0, 105: 78.5, 106: 0, 107: 39.0, 108: 16.0, 109: 26.2, 110: 19.0, 111: 0, 112: 1.5, 113: 6.75, 114: 8.5, 115: 0, 116: 0, 117: 0, 118: 0, 119: 0, 120: 0, 121: 0, 122: 0, 123: 54.0, 124: 0, 125: 0, 126: 0, 127: 0, 128: 0, 129: 21.5, 130: 0, 131: 29.0, 132: 0, 133: 0, 134: 0, 135: 0, 136: 0, 137: 0, 138: 12.5, 139: 13.899999999999999, 140: 6.5, 141: 36.0, 142: 0, 143: 33.0, 144: 0, 145: 1.3, 146: 72.0, 147: 16.3, 148: 0, 149: 63.0, 150: 0, 151: 0, 152: 0, 153: 115.5, 154: 0, 155: 0, 156: 8.5, 157: 0, 158: 5.0, 159: 0, 160: 8.0, 161: 35.5, 162: 45.650000000000006, 163: 0, 164: 0, 165: 0, 166: 12.0, 167: 0, 168: 0.5, 169: 0, 170: 0, 171: 0, 172: 0, 173: 0, 174: 0, 175: 0, 176: 0, 177: 0, 178: 10.0, 179: 0, 180: 5.0, 181: 5.0, 182: 0, 183: 0, 184: 0, 185: 0, 186: 0, 187: 0, 188: 2.5, 189: 0, 190: 0, 191: 0, 192: 23.0, 193: 3.5, 194: 0, 195: 0, 196: 0, 197: 0, 198: 0, 199: 0, 200: 0, 201: 0, 202: 0, 203: 0, 204: 0, 205: 0, 206: 0, 207: 0, 208: 0, 209: 0, 210: 0, 211: 0, 212: 0, 213: 0, 214: 0, 215: 0, 216: 0, 217: 0, 218: 0, 219: 0, 220: 0, 221: 0, 222: 0, 223: 0, 224: 0, 225: 0, 226: 0, 227: 0, 228: 0, 229: 37.5, 230: 34.0, 231: 0, 232: 0, 233: 18.0, 234: 28.0, 235: 15.0, 236: 33.5, 237: 0, 238: 15.0, 239: 0, 240: 0, 241: 0, 242: 0, 243: 0, 244: 0, 245: 0, 246: 0, 247: 0, 248: 0, 249: 0, 250: 0, 251: 0, 252: 0, 253: 19.0, 254: 1.5, 255: 0, 256: 0, 257: 0, 258: 0, 259: 0, 260: 0, 261: 0, 262: 0, 263: 0, 264: 0, 265: 0, 266: 32.1, 267: 0, 268: 81.0, 269: 1.5, 270: 0, 271: 0, 272: 0, 273: 8.5, 274: 5.0, 275: 0, 276: 0, 277: 9.0, 278: 11.5, 279: 8.0, 280: 0, 281: 3.0, 282: 0, 283: 3.5, 284: 0, 285: 0, 286: 0, 287: 0, 288: 0, 289: 2.0, 290: 2.0, 291: 68.05, 292: 0, 293: 0, 294: 5.1, 295: 0, 296: 0, 297: 0, 298: 0, 299: 0, 300: 0, 301: 0, 302: 80.95, 303: 0, 304: 0, 305: 0, 306: 21.0, 307: 8.0, 308: 50.0, 309: 0, 310: 0, 311: 0, 312: 0, 313: 0, 314: 0, 315: 0, 316: 6.0, 317: 2.0, 318: 0, 319: 0, 320: 0, 321: 10.0, 322: 15.5, 323: 33.0, 324: 0, 325: 0, 326: 0, 327: 0, 328: 4.5, 329: 2.5, 330: 17.5, 331: 3.25, 332: 38.0, 333: 61.400000000000006, 334: 1.0, 335: 19.0, 336: 0, 337: 0, 338: 0, 339: 0, 340: 0, 341: 0, 342: 16.5, 343: 0, 344: 0, 345: 0, 346: 0, 347: 0, 348: 0, 349: 29.0, 350: 42.0, 351: 0, 352: 0, 353: 0, 354: 0, 355: 0, 356: 0, 357: 0, 358: 0, 359: 0, 360: 0, 361: 0, 362: 0, 363: 0, 364: 0, 365: 0, 366: 0, 367: 0, 368: 0, 369: 0, 370: 0, 371: 0, 372: 0, 373: 0, 374: 0, 375: 0, 376: 0.5, 377: 0, 378: 0, 379: 0, 380: 0, 381: 0, 382: 0, 383: 0, 384: 0, 385: 0, 386: 0, 387: 0, 388: 0, 389: 0, 390: 0, 391: 0, 392: 0, 393: 0, 394: 0, 395: 0, 396: 0, 397: 0, 398: 6.0, 399: 14.0, 400: 0, 401: 0, 402: 0, 403: 0, 404: 98.8, 405: 34.0, 406: 0, 407: 0, 408: 0, 409: 0, 410: 0, 411: 0, 412: 0, 413: 0, 414: 0, 415: 0, 416: 0, 417: 0, 418: 5.5, 419: 1.0, 420: 0, 421: 0, 422: 0, 423: 0, 424: 0, 425: 0, 426: 0, 427: 0, 428: 0, 429: 0, 430: 0, 431: 0, 432: 0, 433: 0, 434: 52.0, 435: 0, 436: 0, 437: 0, 438: 0, 439: 0, 440: 0, 441: 0, 442: 0, 443: 0, 444: 0, 445: 3.0, 446: 0, 447: 0, 448: 0, 449: 0, 450: 0, 451: 0, 452: 0, 453: 0, 454: 0, 455: 0, 456: 0, 457: 0, 458: 0, 459: 0, 460: 0, 461: 0, 462: 0, 463: 0, 464: 0, 465: 0, 466: 0, 467: 40.0, 468: 10.299999999999999, 469: 49.25, 470: 0, 471: 31.0, 472: 0, 473: 0, 474: 3.0, 475: 0, 476: 87.6, 477: 56.0, 478: 0, 479: 4.0, 480: 0, 481: 7.0, 482: 0, 483: 32.5, 484: 48.45, 485: 29.0, 486: 23.8, 487: 36.0, 488: 0, 489: 0, 490: 0, 491: 16.25, 492: 31.0, 493: 29.0, 494: 0, 495: 0, 496: 0, 497: 0, 498: 0, 499: 0, 500: 0, 501: 0, 502: 0, 503: 0, 504: 0, 505: 0, 506: 0, 507: 7.0, 508: 0, 509: 0, 510: 0, 511: 0, 512: 0, 513: 0, 514: 0, 515: 0, 516: 33.0, 517: 48.0, 518: 0, 519: 54.0, 520: 0, 521: 27.0, 522: 0, 523: 0, 524: 0, 525: 5.0, 526: 0, 527: 0, 528: 0, 529: 0, 530: 0, 531: 0, 532: 0, 533: 7.5, 534: 6.0, 535: 45.75, 536: 14.25, 537: 0, 538: 0, 539: 0, 540: 0, 541: 0, 542: 0, 543: 0, 544: 25.0, 545: 0, 546: 0, 547: 87.0, 548: 25.0, 549: 0, 550: 54.0, 551: 0, 552: 54.0, 553: 0, 554: 3.0, 555: 0, 556: 0, 557: 0, 558: 7.0, 559: 0, 560: 132.5, 561: 59.0, 562: 17.0, 563: 15.5, 564: 0, 565: 0, 566: 0, 567: 0, 568: 0, 569: 0, 570: 0, 571: 0, 572: 0, 573: 0, 574: 0, 575: 0, 576: 0, 577: 0, 578: 0, 579: 0, 580: 1.0, 581: 0, 582: 5.5, 583: 0, 584: 30.5, 585: 0, 586: 0, 587: 5.0, 588: 0, 589: 43.0, 590: 5.1, 591: 0, 592: 0, 593: 11.0, 594: 0, 595: 0, 596: 0, 597: 0, 598: 0, 599: 0, 600: 0, 601: 34.0, 602: 0, 603: 0, 604: 0, 605: 0, 606: 0, 607: 0, 608: 0, 609: 0, 610: 0, 611: 0, 612: 0, 613: 2.5, 614: 0, 615: 78.75, 616: 46.0, 617: 0, 618: 0, 619: 0, 620: 24.5, 621: 0, 622: 8.5, 623: 0, 624: 0, 625: 0, 626: 0, 627: 0, 628: 0, 629: 0, 630: 0, 631: 0, 632: 0, 633: 0, 634: 0, 635: 0, 636: 0, 637: 0, 638: 0, 639: 0, 640: 29.0, 641: 0, 642: 0, 643: 0, 644: 43.0, 645: 35.0, 646: 36.2, 647: 64.5, 648: 20.0, 649: 15.7, 650: 0, 651: 0, 652: 0, 653: 0, 654: 0, 655: 1.0, 656: 0, 657: 6.5, 658: 3.5, 659: 12.5, 660: 7.5, 661: 0, 662: 3.5, 663: 27.0, 664: 0, 665: 40.0, 666: 5.5, 667: 18.0, 668: 87.0, 669: 0, 670: 0, 671: 1.0, 672: 2.0, 673: 0, 674: 51.00000000000001, 675: 0, 676: 19.0, 677: 31.7, 678: 12.0, 679: 0, 680: 0, 681: 0, 682: 0, 683: 1.5, 684: 2.5, 685: 2.0, 686: 0, 687: 2.5, 688: 0, 689: 87.45, 690: 0, 691: 0, 692: 0, 693: 0, 694: 34.0, 695: 2.5, 696: 10.0, 697: 0, 698: 0, 699: 0, 700: 0, 701: 0, 702: 0, 703: 0, 704: 0, 705: 0, 706: 0, 707: 0, 708: 0, 709: 1.5, 710: 0, 711: 0, 712: 0, 713: 0, 714: 0, 715: 0, 716: 0, 717: 0, 718: 0, 719: 0, 720: 0, 721: 0, 722: 0, 723: 0, 724: 0, 725: 0, 726: 0, 727: 0, 728: 0, 729: 0, 730: 0, 731: 0, 732: 3.0, 733: 0, 734: 0, 735: 0, 736: 0, 737: 0, 738: 51.1, 739: 19.5, 740: 0, 741: 12.5, 742: 0, 743: 0, 744: 4.0, 745: 5.1, 746: 0, 747: 0, 748: 5.1, 749: 10.0, 750: 5.0, 751: 0, 752: 5.1, 753: 5.1, 754: 19.0, 755: 0, 756: 23.0, 757: 27.0, 758: 16.5, 759: 0, 760: 30.0, 761: 0, 762: 0, 763: 0, 764: 5.5, 765: 17.0, 766: 30.0, 767: 0, 768: 0, 769: 0, 770: 0, 771: 0, 772: 0, 773: 0, 774: 0, 775: 0, 776: 0, 777: 0, 778: 14.0, 779: 16.0, 780: 55.0, 781: 71.0, 782: 106.1, 783: 0, 784: 0, 785: 0, 786: 9.0, 787: 0, 788: 0, 789: 0, 790: 26.0, 791: 0, 792: 0, 793: 0, 794: 0, 795: 55.5, 796: 0, 797: 43.6, 798: 56.6, 799: 0}\n"
     ]
    }
   ],
   "source": [
    "dict={}\n",
    "yes=0\n",
    "for k in range(0,800):\n",
    "    t=p1[\"参加活动情况描述\"][k]\n",
    "    t=t.replace(\"分\",\"@\")  #此时t为str类型\n",
    "    total=0\n",
    "    p3=ast.literal_eval(t)  #此时p3为list类型\n",
    "#     print(p3)\n",
    "    l=len(p3)\n",
    "    real_done=[]           #带有空列表的分数列表\n",
    "    real_done_done=[]      #去掉空列表的分数列表\n",
    "    for i in range (1,l):\n",
    "        data=p3[i]              #定位到list中的某一个标签\n",
    "        pattern=re.compile(r\"\\d{0,2}\\.{0,1}\\d{1,3}\\@\")    #正则表达式匹配\n",
    "        deal_done=pattern.findall(data)   #找到符合条件的值并打印结果\n",
    "        real_done.append(deal_done)\n",
    "    #去掉空列表\n",
    "    for i in range(0,len(real_done)):\n",
    "        if len(real_done[i])!=0:\n",
    "            real_done_done.append(real_done[i])\n",
    "    #计算分数\n",
    "    for i in range(0,len(real_done_done)):\n",
    "        for j in range(0,len(real_done_done[i])):\n",
    "            mark=float(real_done_done[i][j][:-1])\n",
    "            total=total+mark\n",
    "    print(str(k)+\"   \"+str(total))\n",
    "    dict[k]=total\n",
    "\n",
    "print(dict)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e0af0ed",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
